capture log close
/*==================================================
project:       
Author:        Diego Mayorga 
E-email:       
url:           
Dependencies:  Banco de México
----------------------------------------------------
Creation Date:     4 Mar 2020 - 19:15:57
Modification Date:   
Do-file version:    01
References:          
Output:             
==================================================*/

/*==================================================
              0: Program set up
==================================================*/
version 15.1
drop _all
loc master "B:\Col_Minimum_Wage" 
use "`master'/Data/Source/ocupados.dta"

keep if inrange(time,`=tq(1996q2)',`=tq(2000q2)')

tab time
gen fexs = fex / r(r)

svyset [pw=fexs]
gen unos = 1

/* hmin(30) hmax(50) sex(0) edadm(65) wage(salario) formal exind(13,29,42)*/
log using "B:\Col_Minimum_Wage\Code\Est/est_descriptivatable.txt", replace text
/*==================================================
              1: Total
==================================================*/
svy: mean unos
local total_s = e(N_psu)
local total_p = e(N_pop)


/*==================================================
              2: Workers
==================================================*/
keep if ocupado==3
svy: mean unos 
local workers_s = e(N_psu)
local workers_p = e(N_pop)

/*==================================================
              3: Without Gov and Self
==================================================*/
drop if inlist(tipo_trabajador,1,5,6,7)
svy: mean unos
local gs_s = e(N_psu)
local gs_p = e(N_pop)

/*==================================================
              4: Age Restr
==================================================*/
keep if cedad<=65
svy: mean unos
local age_s = e(N_psu)
local age_p = e(N_pop)

/*==================================================
              5: Hours Restr
==================================================*/
keep if horas_semana>=30 & horas_semana <=50
svy: mean unos
local hours_s = e(N_psu)
local hours_p = e(N_pop)

/*==================================================
              6: City Restr
==================================================*/
keep if inlist(area,5,6,8,11,17,52,68,76)
svy: mean unos
local city_s = e(N_psu)
local city_p = e(N_pop)

/*==================================================
              7: Industry Restr
==================================================*/
keep if !inlist(cactividad_empresa,13,29,42)
svy: mean unos
local ind_s = e(N_psu)
local ind_p = e(N_pop)
/*==================================================
              8: Output
==================================================*/
clear
set obs 7
gen Restriccion=""
gen Muestra=.
gen Poblacion=.

replace Restriccion = "Total" in 1
replace Muestra  = `total_s' in 1
replace Poblacion= `total_p' in 1

replace Restriccion = "Workers" in 2
replace Muestra  = `workers_s' in 2
replace Poblacion= `workers_p' in 2

replace Restriccion = "GovAndSelfEmp" in 3
replace Muestra  = `gs_s' in 3
replace Poblacion= `gs_p' in 3

replace Restriccion = "Age" in 4
replace Muestra  = `age_s' in 4
replace Poblacion= `age_p' in 4

replace Restriccion = "Hour" in 5
replace Muestra  = `hours_s' in 5
replace Poblacion= `hours_p' in 5


replace Restriccion = "City" in 6
replace Muestra  = `city_s' in 6
replace Poblacion= `city_p' in 6

replace Restriccion = "Industry" in 7
replace Muestra  = `ind_s' in 7
replace Poblacion= `ind_p' in 7

export excel using "B:\Col_Minimum_Wage\Ster\descriptive\TablaNúmeros.xlsx",firstrow(variables) replace


log close
exit
/* End of do-file */

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

Notes:
1.
2.
3.


Version Control:


